package requests

import (
	"github.com/goravel/framework/contracts/http"
	"github.com/goravel/framework/contracts/validation"
)

type TicketRequest struct {
	ParkingID  uint   `form:"parking_id" json:"parking_id"`
	RepairID   uint   `form:"repair_id" json:"repair_id"`
	KindID     uint   `form:"kind_id" json:"kind_id"`
	State      int    `form:"state" json:"state"`
	ServiceIDs []uint `form:"service_ids" json:"service_ids"`
	UserIDs    []uint `form:"user_ids" json:"user_ids"`
}

func (r *TicketRequest) Authorize(ctx http.Context) error {
	return nil
}

func (r *TicketRequest) Rules(ctx http.Context) map[string]string {
	return map[string]string{
		"repair_id":   "required",
		"kind_id":     "required",
		"service_ids": "required",
		"user_ids":    "required",
	}
}

func (r *TicketRequest) Messages(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *TicketRequest) Attributes(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *TicketRequest) PrepareForValidation(ctx http.Context, data validation.Data) error {
	return nil
}
